package cn.edu.neu.vmmigeval.cloud.entity;

import cn.edu.neu.vmmigeval.cloud.policy.CloudletScheduler;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by yfwz100 on 16/2/25.
 */
public class Vm {

    /** The id. */
    private int id;

    /** The ram. */
    private int currentCpu;

    /** The ram. */
    private int totalCpu;

    /** The ram. */
    private int currentRam;

    /** The ram. */
    private int totalRam;

    /** The bw. */
    private int currentBw;

    /** The bw. */
    private int totalBw;

    /** The bw. */
    private int currentDisk;

    /** The bw. */
    private int totalDisk;

    /** The Cloudlet scheduler. */
    private CloudletScheduler cloudletScheduler;

    /** The host. */
    private Host host;

    /** In migration flag. */
    private boolean inMigration;


    private List<Cloudlet> cloudlets;

    private List<Double> utilizationHistory =new ArrayList<Double>();

    private double sortFactor;

    private double score;

    public Vm(int id,int totalCpu, int totalRam, int totalBw, int totalDisk,
              CloudletScheduler cloudletScheduler) {
        super();
        this.id = id;
        this.totalCpu = totalCpu;
        this.totalRam = totalRam;
        this.totalBw = totalBw;
        this.totalDisk = totalDisk;
        this.cloudletScheduler = cloudletScheduler;
    }

    public Vm(int id, int currentCpu, int totalCpu, int currentRam,
              int totalRam, int currentBw, int totalBw, int currentDisk,
              int totalDisk, CloudletScheduler cloudletScheduler, Host host,
              boolean inMigration) {
        super();
        this.id = id;
        this.currentCpu = currentCpu;
        this.totalCpu = totalCpu;
        this.currentRam = currentRam;
        this.totalRam = totalRam;
        this.currentBw = currentBw;
        this.totalBw = totalBw;
        this.currentDisk = currentDisk;
        this.totalDisk = totalDisk;
        this.cloudletScheduler = cloudletScheduler;
        this.host = host;
        this.inMigration = inMigration;
    }

    public Vm() {
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getCurrentCpu() {
        return currentCpu;
    }

    public void setCurrentCpu(int currentCpu) {
        this.currentCpu = currentCpu;
    }

    public int getTotalCpu() {
        return totalCpu;
    }

    public void setTotalCpu(int totalCpu) {
        this.totalCpu = totalCpu;
    }

    public int getCurrentRam() {
        return currentRam;
    }

    public void setCurrentRam(int currentRam) {
        this.currentRam = currentRam;
    }

    public int getTotalRam() {
        return totalRam;
    }

    public void setTotalRam(int totalRam) {
        this.totalRam = totalRam;
    }

    public int getCurrentBw() {
        return currentBw;
    }

    public void setCurrentBw(int currentBw) {
        this.currentBw = currentBw;
    }

    public int getTotalBw() {
        return totalBw;
    }

    public void setTotalBw(int totalBw) {
        this.totalBw = totalBw;
    }

    public int getCurrentDisk() {
        return currentDisk;
    }

    public void setCurrentDisk(int currentDisk) {
        this.currentDisk = currentDisk;
    }

    public int getTotalDisk() {
        return totalDisk;
    }

    public void setTotalDisk(int totalDisk) {
        this.totalDisk = totalDisk;
    }

    public CloudletScheduler getCloudletScheduler() {
        return cloudletScheduler;
    }

    public void setCloudletScheduler(CloudletScheduler cloudletScheduler) {
        this.cloudletScheduler = cloudletScheduler;
    }

    public Host getHost() {
        return host;
    }

    public void setHost(Host host) {
        this.host = host;
    }

    public boolean isInMigration() {
        return inMigration;
    }

    public void setInMigration(boolean inMigration) {
        this.inMigration = inMigration;
    }

    public List<Cloudlet> getCloudlets() {
        return cloudlets;
    }

    public void setCloudlets(List<Cloudlet> cloudlets) {
        this.cloudlets = cloudlets;
    }

    public List<Double> getUtilizationHistory() {
        return utilizationHistory;
    }

    public void setUtilizationHistory(List<Double> utilizationHistory) {
        this.utilizationHistory = utilizationHistory;
    }

    public double getSortFactor() {
        return sortFactor;
    }

    public void setSortFactor(double sortFactor) {
        this.sortFactor = sortFactor;
    }

    public double getScore() {
        return score;
    }

    public void setScore(double score) {
        this.score = score;
    }




}
